<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!--
Beyond Admin - Responsive Admin Dashboard Template build with Twitter Bootstrap 3
Version: 1.0.0
Purchase: http://wrapbootstrap.com
-->

<html xmlns="http://www.w3.org/1999/xhtml">
<!--Head-->
<head>
<%@ include file="/commonadmin/include/admin_include.jsp" %>

<meta name="description" content="register page" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon"
	href="<%=request.getContextPath()%>/commonadmin/assets/img/favicon.png"
	type="image/x-icon">

<!--Basic Styles-->
<link
	href="<%=request.getContextPath()%>/commonadmin/assets/css/bootstrap.min.css"
	rel="stylesheet" />
<link id="bootstrap-rtl-link" href="" rel="stylesheet" />
<link
	href="<%=request.getContextPath()%>/commonadmin/assets/css/font-awesome.min.css"
	rel="stylesheet" />

<!--Fonts-->
<link
	href="<%=request.getContextPath()%>/commonadmin/js/font-useso.js"
	rel="stylesheet" type="text/css">

<!--Beyond styles-->
<link
	href="<%=request.getContextPath()%>/commonadmin/assets/css/beyond.min.css"
	rel="stylesheet" />
<link
	href="<%=request.getContextPath()%>/commonadmin/assets/css/demo.min.css"
	rel="stylesheet" />
<link
	href="<%=request.getContextPath()%>/commonadmin/assets/css/animate.min.css"
	rel="stylesheet" />
<link id="skin-link" href="" rel="stylesheet" type="text/css" />

<!--Skin Script: Place this script in head to load scripts for skins and rtl support-->
<script
	src="<%=request.getContextPath()%>/commonadmin/assets/js/skins.min.js"></script>
</head>

	
</script>
<!--Head Ends-->
<!--Body-->
<body>
	<form action="<%=request.getContextPath()%>/admin/message/addMessage.htm" method="post" id="adminAppend" name="adminAppend">
		<div class="register-container animated fadeInDown">
			<div class="registerbox bg-white">
				<div class="registerbox-caption "></div>
				<div class="registerbox-caption "></div>
				<div class="registerbox-caption "></div>
				<div class="registerbox-title" style="text-align: center;">添加系统消息</div>

				<div class="registerbox-caption "></div>
				<div class="registerbox-caption "></div>
				<div class="registerbox-textbox">
					<input type="text" class="form-control" placeholder="内容:"
						name="content" id="content" required accunt/>
				</div>
				<div class="registerbox-caption "></div>
				<div class="registerbox-caption ">
					<span id="test" style="color: red;"></span>
				</div>
				<div class="registerbox-caption ">
					
				</div>
				<div class="registerbox-submit">
					<input type="submit" class="btn btn-primary pull-left" value="添加">
				</div>
				<div class="registerbox-submit">
					<input type="button" class="btn btn-primary pull-right" value="关闭"
						onclick="window.close()">
				</div>
			</div>
		</div>
	</form>
	
	<!--Basic Scripts-->
	<%-- <script src="<%=request.getContextPath()%>/commonadmin/assets/js/jquery-2.0.3.min.js"></script>
	<script type="text/javascript" src="<%=request.getContextPath()%>/commonadmin/component/jquery/jquery.validate.js"></script> --%>
	<script
		src="<%=request.getContextPath()%>/commonadmin/assets/js/bootstrap.min.js"></script>

	<!--Beyond Scripts-->
	<script
		src="<%=request.getContextPath()%>/commonadmin/assets/js/beyond.min.js"></script>
	<script type="text/javascript">
		function back(){
			location.href = "<%=request.getContextPath()%>/admin/adminUserCheck.htm";
		}
		//上传图片
		$("#header").on("click",function(){
			$("#tap").val("1");
			$("#container").show();
		})
		var cropper;

function init()
{   
    //绑定
    cropper = new ImageCropper(500, 500, 500, 500);
    cropper.setCanvas("cropper");
    cropper.addPreview("preview180");
    cropper.addPreview("preview100");
    cropper.addPreview("preview50");
    //检测用户浏览器是否支持imagecropper插件
    if(!cropper.isAvaiable())
    {
        alert("Sorry, your browser doesn't support FileReader, please use Firefox3.6+ or Chrome10+ to run it.");
    }
}

//打开本地图片
function selectImage(fileList)
{
    cropper.loadImage(fileList[0]);
    cropper1.loadImage(fileList[0]);
}

//旋转图片
function rotateImage(e)
{
    switch(e.target.id)
    {
        case "rotateLeftBtn":
            cropper.rotate(-90);
            break;
        case "rotateRightBtn":
            cropper.rotate(90);
            break;
    }
}

//上传头像图片
function saveImage()
{

    if($("#tap").val()==1){
    	//选个你需要的大小
        var imgData1 = cropper.getCroppedImageData(180, 180);
        var imgData=imgData1.replace(/^data:image\/(png|jpg);base64,/, "");
        console.log("上传了："+imgData);
    	$("#input").val("");
    	$("#header").attr("src",imgData1);
    	$("#img_header").val(imgData);
    	//上传头像
    	
    }
    
	console.log(imgData);
	$("#container").hide();
	$("#tap").val("");
    //在这里写你的上传代码
}


		
	</script>
</body>
<!--Body Ends-->
</html>
